tests/testtooltips.c: Use accessor functions to access GtkWidget
authorJavier Jardón <jjardon@gnome.org>
Sun, 15 Aug 2010 22:31:53 +0000 (00:31 +0200)
committerJavier Jardón <jjardon@gnome.org>
Sun, 22 Aug 2010 16:30:58 +0000 (18:30 +0200)
tests/testtooltips.c

index 8aee9583e66ccd48b1c35c32444c5739c5265bee..c228c23241e9e6f73e0379a7e0e0f42282746108 100644 (file)
@@ -209,16 +209,19 @@ drawing_area_expose (GtkWidget      *drawing_area,
                     GdkEventExpose *event,
                     gpointer        data)
 {
+  GtkAllocation allocation;
+  GdkWindow *window;
   gint i;
   cairo_t *cr;
 
-  gdk_window_get_pointer (drawing_area->window, NULL, NULL, NULL);
+  window =  gtk_widget_get_window (drawing_area);
 
-  cr = gdk_cairo_create (drawing_area->window);
+  gdk_window_get_pointer (window, NULL, NULL, NULL);
 
-  cairo_rectangle (cr, 0, 0,
-                  drawing_area->allocation.width,
-                  drawing_area->allocation.height);
+  cr = gdk_cairo_create (window);
+
+  gtk_widget_get_allocation (drawing_area, &allocation);
+  cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
   cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
   cairo_fill (cr);